<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增采购')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-purchase-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">采购订单号：</label>
                <div class="col-sm-8">
                    <input name="purchaseOrderNumber" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">采购状态 ：</label>
                <div class="col-sm-8">
                    <select class="form-control" name="purchaseOrderState" disabled="disabled">
                        <option value="0">未审批</option>
                        <option value="1">已审批</option>
                        <option value="2">已打款</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">采购单位：</label>
                <div class="col-sm-8">
                    <input name="purchasingUnit" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">采购人：</label>
                <div class="col-sm-8">
                    <input name="purchasingPeople" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">采购日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input type="text" name="purchaseDateStr" class="form-control" id="datetimepicker-demo-2" placeholder="yyyy-MM-dd">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">

        $("#datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        var prefix = ctx + "system/purchase"
        $("#form-purchase-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-purchase-add').serialize());
            }
        }
    </script>
</body>
</html>
